package com.wyg.aop;

import com.wyg.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/aop")
    public void aopTest(/*@RequestBody User user*/){
        User user = new User();
        user.setId("1");
        user.setName("张三");
//        UserValidate userValidate = (UserValidate) userService;
//        if (userValidate.validate(user)){
//            userService.printUser(user);
//        }
        userService.printUser(user);
    }
}
